<h1 align = 'center'>DAMAGE / REPAIR REPORT</h1>
<?php
    $this->load->database();
    $selectAllQ = 'SELECT DateReported,FacilityName,FacilityType,RoomAssigned,CasualtyDesc FROM pf_casualty,pf_facilities WHERE pf_casualty.FacilityID = pf_facilities.FacilityID AND pf_casualty.Status = 0 AND pf_facilities.Status != -1';
    $selectAllR = $this->db->query($selectAllQ);
    if($selectAllR->num_rows() > 0)
    {
        echo '<table align = "center" border = 5><tr><th>Date Reported</th><th>Location</th><th>Facility Type</th><th>Facility Name</th><th>Damage Description</th></tr>';
        foreach($selectAllR->result() as $selectAll)
        {
            echo '<tr><td>'.$selectAll->DateReported.'</td><td>'.$selectAll->RoomAssigned.'</td><td>'.$selectAll->FacilityType.'</td><td>'.$selectAll->FacilityName.'</td><td>'.$selectAll->CasualtyDesc.'</td></tr>';
        }
        echo '</table>';
    }
    else
    {
        echo '<h5 align = "center"><i>repairable facilities empty</i></h5>';
    }
    
?>